package com.ruoyi.system.controller;

import com.ruoyi.system.domain.vo.PositionNumVo;
import com.ruoyi.system.domain.vo.UserPositionVo;
import com.ruoyi.system.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xy
 * @version 1.0
 * @description:
 * @date 2024/7/6 9:26
 */
@Api(tags = "用户管理模块")
@RestController
@RequestMapping("/system/myUser")
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/map")
    @ApiOperation("查询每个省份的用户量")
    public List<PositionNumVo> getProvinceCount() {
        return userService.selectProvinceNum();
    }

    @GetMapping("/position")
    @ApiOperation("查询用户的地址信息")
    public UserPositionVo getUserPosition(@ApiParam(name = "userId", value = "用户ID", required = true) @RequestParam
                                                  Long userId) {
        return userService.selectUserPosition(userId);
    }
}
